use futures::executor::block_on;
use sgs_vm::core::{token::TokenDecoder, vm::Svm};


fn main(){
    let mut svm = Svm::new(false);
    let res = std::fs::read_to_string("./data/sgs.json");
    if let Ok(code) = res{
        let res = TokenDecoder::parse(code);
        match res {
            Ok(tokens) => {
                let f = svm.execute(tokens);
                block_on(f);
            }
            Err(e) => println!("{}", e),
        }
    }else{
        println!("code file not found");
    }
      
}